<?php
require __DIR__ . '/vendor/autoload.php';
use Workerman\Worker;

$worker = new Worker();
$worker->onWorkerStart = function(){
    //$mqtt = new Workerman\Mqtt\Client('mqtt://47.104.80.105:1883');
	$mqtt = new Workerman\Mqtt\Client('mqtt://192.168.61.106:61616');
    $mqtt->onConnect = function($mqtt) {
        //$mqtt->subscribe('workerman-test');
		$mqtt->subscribe('mytest');
    };
    $mqtt->onMessage = function($topic, $content){
        var_dump($topic, $content);
    };
    $mqtt->connect();
};
Worker::runAll();
